package club.qwertyzzz;

import java.io.IOException;
import java.util.Properties;

public class PropertyMgr {

    private static Properties properties = new Properties();

    static {
        try {
            properties.load(PropertyMgr.class.getClassLoader().getResourceAsStream("config.properties"));
        } catch (IOException e) {
            e.printStackTrace();
        }
    }

    /**
     * 获取属性值
     * @param key
     * @return
     */
    public static Object get(String key) {
        if(properties.get(key) == null) {
            return null;
        } else {
            return properties.get(key);
        }
    }
}
